#import "GrumpyApexCell.h"


@implementation GrumpyApexCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self wanderSetupViews];
	}
	return self;
}

- (void)setGlowWandererWaffle:(GrumpyApexModel *)glowWandererWaffle {
	_glowWandererWaffle = glowWandererWaffle;

	//: 配置cell的UI

[self.arcanePathwayImageView sd_setImageWithURL:[NSURL URLWithString:glowWandererWaffle.enchantingHover.stringValue] placeholderImage:nil];

	self.luminousLabel.text = glowWandererWaffle.humbleQuench;

}
- (UIView *)xeroxView {
	if (!_xeroxView) {
	
        _xeroxView = [UIView new];
	}
	return _xeroxView;
}

- (UITextView *)wanderTextView {
	if (!_wanderTextView) {
	
        _wanderTextView = [[UITextView alloc] init];
        _wanderTextView.size = CGSizeMake(188, 182);
        _wanderTextView.left = 36;
        _wanderTextView.top = 19;
	}
	return _wanderTextView;
}

//: 设置_apexImageView的圆角
- (void)blaze:(UIImageView *)dazzle abandonMagnitudeKingdom:(CGFloat)insectDelightfulQuaint {
	dazzle.layer.cornerRadius = insectDelightfulQuaint;
	dazzle.layer.masksToBounds = YES;
}

- (UIImageView *)apexImageView {
	if (!_apexImageView) {
	
        _apexImageView = [[UIImageView alloc] init];
        _apexImageView.contentMode = UIViewContentModeScaleAspectFill;
        _apexImageView.clipsToBounds = YES;
        //: UIImageView的骚操作 充数
        [self blaze:_apexImageView abandonMagnitudeKingdom:10];
        _apexImageView.frame = CGRectMake(44, 20, 132, 181);
        UIImage *kingdomEnchanting = [UIImage imageNamed:@"images/image_5.png"];
        if (kingdomEnchanting) {
	        _apexImageView.image = kingdomEnchanting;
        }
	}
	return _apexImageView;
}

- (UILabel *)luminousLabel {
	if (!_luminousLabel) {
	
        _luminousLabel = [[UILabel alloc] init];
        _luminousLabel.frame = CGRectMake(19, 27, 35, 80);
        _luminousLabel.text = @"label_6";
        _luminousLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightRegular];
        _luminousLabel.textColor = [UIColor colorWithRed:86/255.0 green:186/255.0 blue:91/255.0 alpha:1.0];
        _luminousLabel.textAlignment = NSTextAlignmentLeft;
        //: 不用理会的骚操作 = _luminousLabel.numberOfLines = 1;
        NSInteger yard = 1;
        if (yard>71 && yard < 3840) {
	        yard = 71;
        }
        _luminousLabel.numberOfLines = yard;
	}
	return _luminousLabel;
}

- (void)wanderSetupViews {

    //: 描述_0
    UILabel *flourishLuminousJourney = [UILabel new];
    flourishLuminousJourney.size = CGSizeMake(57, 115);
    flourishLuminousJourney.left = 25;
    flourishLuminousJourney.top = 31;
    flourishLuminousJourney.text = @"label_0";
    flourishLuminousJourney.font = [UIFont systemFontOfSize:17 weight:UIFontWeightBold];
    flourishLuminousJourney.textColor = [UIColor colorWithRed:81/255.0 green:245/255.0 blue:2/255.0 alpha:0.6];
    flourishLuminousJourney.textAlignment = NSTextAlignmentRight;
    flourishLuminousJourney.numberOfLines = 3;
    self.nightfallTranquilityLabel = flourishLuminousJourney;
    [self.contentView addSubview:flourishLuminousJourney];


    //: 描述_1
    UITextView *imaginationWonderSwoop = [[UITextView alloc] initWithFrame:CGRectZero];
    self.dabbleGlistenVirtuousTextView = imaginationWonderSwoop;
    [self.contentView addSubview:imaginationWonderSwoop];
	[self.dabbleGlistenVirtuousTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(95);
		make.height.mas_equalTo(108);
		make.top.equalTo(@(12));
		make.bottom.equalTo(@(23));
	}];

	//: 描述_2
	[self.contentView addSubview:self.xeroxView];
	[self.xeroxView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(153);
		make.height.mas_equalTo(90);
		make.top.equalTo(@(29));
	}];


    //: 描述_3
    UIImageView *insectHoverAnticipate = [[UIImageView alloc] initWithFrame:CGRectZero];
    insectHoverAnticipate.contentMode = UIViewContentModeScaleAspectFill;
    insectHoverAnticipate.clipsToBounds = YES;
    insectHoverAnticipate.layer.cornerRadius = 7;
    insectHoverAnticipate.layer.masksToBounds = YES;
    insectHoverAnticipate.size = CGSizeMake(123, 97);
    insectHoverAnticipate.left = 10;
    insectHoverAnticipate.top = 28;
    UIImage *igniteYearlingJelly = [UIImage imageNamed:@"images/image_3.png"];
    if (igniteYearlingJelly) {
	    insectHoverAnticipate.image = igniteYearlingJelly;
    }
    self.arcanePathwayImageView = insectHoverAnticipate;
    [self.contentView addSubview:insectHoverAnticipate];

	//: 描述_4
	[self.contentView addSubview:self.wanderTextView];

	//: 描述_5
	[self.contentView addSubview:self.apexImageView];

	//: 描述_6
	[self.contentView addSubview:self.luminousLabel];
}


@end